<template>
  <div class="message-item">
    <div>
      <img :src="avatar" alt="" class="message-item_avatar" />
    </div>
    <div class="message-item_content">
      <div class="message-item_title">{{ title }}</div>
      <div class="message-item_footer">
        <div class="message-item_createdTime">{{ createdTime }}</div>
        <div class="message-item_readCount">{{ readCount }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { defineProps, withDefaults } from 'vue';
import { MyMessageData } from '@/api/my-message'
withDefaults(defineProps<MyMessageData>(), {
  avatar: '--',
  title: '--',
  createdTime: '--',
  readCount: '--'
});
</script>

<style lang="less" scoped>
.message-item {
  padding: 12px;
  background: #fff;
  max-width: 457px;
  display: flex;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
  border: 1px solid #e5e5e5;

  &_avatar {
    width: 42px;
    height: 42px;
    border-radius: 10%;
  }

  &_title {
    font-size: 16px;
    font-weight: 600;
  }

  &_content {
    flex: 1;
    margin-left: 12px;
  }

  &_footer {
    display: flex;
    justify-content: space-between;
  }

  &_createdTime {
    font-size: 14px;
    color: #999999;
  }

  &_readCount {
    font-size: 14px;
    color: #999999;
  }
}
</style>
